home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1989 …il & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / MPW Goodies / Interfaces / PInterfaces / Windows.p < prev   
Encoding:
Text File  |  1988-11-30  |  7.4 KB  |  280 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Wednesday, September 7, 1988 at 2:38 PM
  3.     Windows.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.  1985-1988
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Windows;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingWindows}
  21. {$SETC UsingWindows := 1}
  22.  
  23. {$I+}
  24. {$SETC WindowsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingEvents}
  30. {$I $$Shell(PInterfaces)Events.p}
  31. {$ENDC}
  32. {$IFC UNDEFINED UsingControls}
  33. {$I $$Shell(PInterfaces)Controls.p}
  34. {$ENDC}
  35. {$SETC UsingIncludes := WindowsIncludes}
  36.  
  37. CONST
  38. documentProc = 0;
  39. dBoxProc = 1;
  40. plainDBox = 2;
  41. altDBoxProc = 3;
  42. noGrowDocProc = 4;
  43. zoomDocProc = 8;
  44. zoomNoGrow = 12;
  45. rDocProc = 16;
  46. dialogKind = 2;
  47. userKind = 8;
  48.  
  49. { FindWindow Result Codes }
  50.  
  51. inDesk = 0;
  52. inMenuBar = 1;
  53. inSysWindow = 2;
  54. inContent = 3;
  55. inDrag = 4;
  56. inGrow = 5;
  57. inGoAway = 6;
  58. inZoomIn = 7;
  59. inZoomOut = 8;
  60.  
  61. { window messages }
  62.  
  63. wDraw = 0;
  64. wHit = 1;
  65. wCalcRgns = 2;
  66. wNew = 3;
  67. wDispose = 4;
  68. wGrow = 5;
  69. wDrawGIcon = 6;
  70.  
  71. { defProc hit test codes }
  72.  
  73. wNoHit = 0;
  74. wInContent = 1;
  75. wInDrag = 2;
  76. wInGrow = 3;
  77. wInGoAway = 4;
  78. wInZoomIn = 5;
  79. wInZoomOut = 6;
  80. deskPatID = 16;
  81.  
  82. { Window Part Identifiers which correlate color table entries with window elements }
  83.  
  84. wContentColor = 0;
  85. wFrameColor = 1;
  86. wTextColor = 2;
  87. wHiliteColor = 3;
  88. wTitleBarColor = 4;
  89.  
  90.  
  91. TYPE
  92.  
  93.  
  94. WStateData = RECORD
  95.     userState: Rect;            {user state}
  96.     stdState: Rect;             {standard state}
  97.     END;
  98.  
  99. AuxWinPtr = ^AuxWinRec;
  100. AuxWinHndl = ^AuxWinPtr;
  101. AuxWinRec = RECORD
  102.     awNext: AuxWinHndl;         {handle to next AuxWinRec}
  103.     awOwner: WindowPtr;         {ptr to window }
  104.     awCTable: CTabHandle;       {color table for this window}
  105.     dialogCItem: Handle;        {handle to dialog manager structures}
  106.     awFlags: LONGINT;           {reserved for expansion}
  107.     awReserved: CTabHandle;     {reserved for expansion}
  108.     awRefCon: LONGINT;          {user Constant}
  109.     END;
  110.  
  111. WCTabPtr = ^WinCTab;
  112. WCTabHandle = ^WCTabPtr;
  113. WinCTab = RECORD
  114.     wCSeed: LONGINT;            {reserved}
  115.     wCReserved: INTEGER;        {reserved}
  116.     ctSize: INTEGER;            {usually 4 for windows}
  117.     ctTable: ARRAY [0..4] OF ColorSpec;
  118.     END;
  119.  
  120. WindowPeek = ^WindowRecord;
  121. WindowRecord = RECORD
  122.     port: GrafPort;
  123.     windowKind: INTEGER;
  124.     visible: BOOLEAN;
  125.     hilited: BOOLEAN;
  126.     goAwayFlag: BOOLEAN;
  127.     spareFlag: BOOLEAN;
  128.     strucRgn: RgnHandle;
  129.     contRgn: RgnHandle;
  130.     updateRgn: RgnHandle;
  131.     windowDefProc: Handle;
  132.     dataHandle: Handle;
  133.     titleHandle: StringHandle;
  134.     titleWidth: INTEGER;
  135.     controlList: ControlHandle;
  136.     nextWindow: WindowPeek;
  137.     windowPic: PicHandle;
  138.     refCon: LONGINT;
  139.     END;
  140.  
  141. CWindowPeek = ^CWindowRecord;
  142. CWindowRecord = RECORD
  143.     port: CGrafPort;
  144.     windowKind: INTEGER;
  145.     visible: BOOLEAN;
  146.     hilited: BOOLEAN;
  147.     goAwayFlag: BOOLEAN;
  148.     spareFlag: BOOLEAN;
  149.     strucRgn: RgnHandle;
  150.     contRgn: RgnHandle;
  151.     updateRgn: RgnHandle;
  152.     windowDefProc: Handle;
  153.     dataHandle: Handle;
  154.     titleHandle: StringHandle;
  155.     titleWidth: INTEGER;
  156.     controlList: ControlHandle;
  157.     nextWindow: CWindowPeek;
  158.     windowPic: PicHandle;
  159.     refCon: LONGINT;
  160.     END;
  161.  
  162.  
  163.  
  164. PROCEDURE InitWindows;
  165.     INLINE $A912;
  166. PROCEDURE GetWMgrPort(VAR wPort: GrafPtr);
  167.     INLINE $A910;
  168. FUNCTION NewWindow(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  169.     theProc: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT): WindowPtr;
  170.     INLINE $A913;
  171. FUNCTION GetNewWindow(windowID: INTEGER;wStorage: Ptr;behind: WindowPtr): WindowPtr;
  172.     INLINE $A9BD;
  173. PROCEDURE CloseWindow(theWindow: WindowPtr);
  174.     INLINE $A92D;
  175. PROCEDURE DisposeWindow(theWindow: WindowPtr);
  176.     INLINE $A914;
  177. PROCEDURE GetWTitle(theWindow: WindowPtr;VAR title: Str255);
  178.     INLINE $A919;
  179. PROCEDURE SelectWindow(theWindow: WindowPtr);
  180.     INLINE $A91F;
  181. PROCEDURE HideWindow(theWindow: WindowPtr);
  182.     INLINE $A916;
  183. PROCEDURE ShowWindow(theWindow: WindowPtr);
  184.     INLINE $A915;
  185. PROCEDURE ShowHide(theWindow: WindowPtr;showFlag: BOOLEAN);
  186.     INLINE $A908;
  187. PROCEDURE HiliteWindow(theWindow: WindowPtr;fHilite: BOOLEAN);
  188.     INLINE $A91C;
  189. PROCEDURE BringToFront(theWindow: WindowPtr);
  190.     INLINE $A920;
  191. PROCEDURE SendBehind(theWindow: WindowPtr;behindWindow: WindowPtr);
  192.     INLINE $A921;
  193. FUNCTION FrontWindow: WindowPtr;
  194.     INLINE $A924;
  195. PROCEDURE DrawGrowIcon(theWindow: WindowPtr);
  196.     INLINE $A904;
  197. PROCEDURE MoveWindow(theWindow: WindowPtr;hGlobal: INTEGER;vGlobal: INTEGER;
  198.     front: BOOLEAN);
  199.     INLINE $A91B;
  200. PROCEDURE SizeWindow(theWindow: WindowPtr;w: INTEGER;h: INTEGER;fUpdate: BOOLEAN);
  201.     INLINE $A91D;
  202. PROCEDURE ZoomWindow(theWindow: WindowPtr;partCode: INTEGER;front: BOOLEAN);
  203.     INLINE $A83A;
  204. PROCEDURE InvalRect(badRect: Rect);
  205.     INLINE $A928;
  206. PROCEDURE InvalRgn(badRgn: RgnHandle);
  207.     INLINE $A927;
  208. PROCEDURE ValidRect(goodRect: Rect);
  209.     INLINE $A92A;
  210. PROCEDURE ValidRgn(goodRgn: RgnHandle);
  211.     INLINE $A929;
  212. PROCEDURE BeginUpdate(theWindow: WindowPtr);
  213.     INLINE $A922;
  214. PROCEDURE EndUpdate(theWindow: WindowPtr);
  215.     INLINE $A923;
  216. PROCEDURE SetWRefCon(theWindow: WindowPtr;data: LONGINT);
  217.     INLINE $A918;
  218. FUNCTION GetWRefCon(theWindow: WindowPtr): LONGINT;
  219.     INLINE $A917;
  220. PROCEDURE SetWindowPic(theWindow: WindowPtr;pic: PicHandle);
  221.     INLINE $A92E;
  222. FUNCTION GetWindowPic(theWindow: WindowPtr): PicHandle;
  223.     INLINE $A92F;
  224. FUNCTION CheckUpdate(VAR theEvent: EventRecord): BOOLEAN;
  225.     INLINE $A911;
  226. PROCEDURE ClipAbove(window: WindowPeek);
  227.     INLINE $A90B;
  228. PROCEDURE SaveOld(window: WindowPeek);
  229.     INLINE $A90E;
  230. PROCEDURE DrawNew(window: WindowPeek;update: BOOLEAN);
  231.     INLINE $A90F;
  232. PROCEDURE PaintOne(window: WindowPeek;clobberedRgn: RgnHandle);
  233.     INLINE $A90C;
  234. PROCEDURE PaintBehind(startWindow: WindowPeek;clobberedRgn: RgnHandle);
  235.     INLINE $A90D;
  236. PROCEDURE CalcVis(window: WindowPeek);
  237.     INLINE $A909;
  238. PROCEDURE CalcVisBehind(startWindow: WindowPeek;clobberedRgn: RgnHandle);
  239.     INLINE $A90A;
  240. FUNCTION GrowWindow(theWindow: WindowPtr;startPt: Point;bBox: Rect): LONGINT;
  241.     INLINE $A92B;
  242. FUNCTION FindWindow(thePoint: Point;VAR theWindow: WindowPtr): INTEGER;
  243.     INLINE $A92C;
  244. FUNCTION PinRect(theRect: Rect;thePt: Point): LONGINT;
  245.     INLINE $A94E;
  246. FUNCTION DragGrayRgn(theRgn: RgnHandle;startPt: Point;boundsRect: Rect;
  247.     slopRect: Rect;axis: INTEGER;actionProc: ProcPtr): LONGINT;
  248.     INLINE $A905;
  249. FUNCTION TrackBox(theWindow: WindowPtr;thePt: Point;partCode: INTEGER): BOOLEAN;
  250.     INLINE $A83B;
  251. PROCEDURE GetCWMgrPort(VAR wMgrCPort: CGrafPtr);
  252.     INLINE $AA48;
  253. PROCEDURE SetWinColor(theWindow: WindowPtr;newColorTable: WCTabHandle);
  254.     INLINE $AA41;
  255. FUNCTION GetAuxWin(theWindow: WindowPtr;VAR awHndl: AuxWinHndl): BOOLEAN;
  256.     INLINE $AA42;
  257. PROCEDURE SetDeskCPat(deskPixPat: PixPatHandle);
  258.     INLINE $AA47;
  259. FUNCTION NewCWindow(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  260.     procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT): WindowPtr;
  261.     INLINE $AA45;
  262. FUNCTION GetNewCWindow(windowID: INTEGER;wStorage: Ptr;behind: WindowPtr): WindowPtr;
  263.     INLINE $AA46;
  264. FUNCTION GetWVariant(theWindow: WindowPtr): INTEGER;
  265.     INLINE $A80A;
  266. FUNCTION GetGrayRgn: RgnHandle;
  267. PROCEDURE SetWTitle(theWindow: WindowPtr;title: Str255);
  268.     INLINE $A91A;
  269. FUNCTION TrackGoAway(theWindow: WindowPtr;thePt: Point): BOOLEAN;
  270.     INLINE $A91E;
  271. PROCEDURE DragWindow(theWindow: WindowPtr;startPt: Point;boundsRect: Rect);
  272.     INLINE $A925;
  273.  
  274. {$ENDC}    { UsingWindows }
  275.  
  276. {$IFC NOT UsingIncludes}
  277.     END.
  278. {$ENDC}
  279.  
  280.